<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>AdminLTE 3 | Dashboard</title>
    <style>
        i {
            width: 20px;
            text-align: center;
        }

        .li_power {
            display: none;
        }
    </style>

    <link rel="stylesheet" href="css/login.css"/>

    <!-- Google Font: Source Sans Pro -->
    <link rel="stylesheet" href="./fonts/googleapis.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="plugins/fontawesome-free/css/all.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="./css/ionicframework.css">
    <!-- Tempusdominus Bootstrap 4 -->
    <link rel="stylesheet" href="plugins/tempusdominus-bootstrap-4/css/tempusdominus-bootstrap-4.min.css">
    <!-- iCheck -->
    <link rel="stylesheet" href="plugins/icheck-bootstrap/icheck-bootstrap.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="dist/css/adminlte.min.css">
    <!-- overlayScrollbars -->
    <link rel="stylesheet" href="plugins/overlayScrollbars/css/OverlayScrollbars.min.css">
    <!-- Daterange picker -->
    <link rel="stylesheet" href="plugins/daterangepicker/daterangepicker.css">
    <!-- summernote -->
    <link rel="stylesheet" href="plugins/summernote/summernote-bs4.min.css">
</head>

<body class="hold-transition sidebar-mini layout-fixed">
<div class="wrapper cont">
    <!-- Preloader -->
    <div class="preloader flex-column justify-content-center align-items-center">
        <span>微小区管理</span>
    </div>

    <!-- 顶部导航栏 -->
    <nav class="main-header navbar navbar-expand navbar-light">

        <!-- 左侧 -->
        <ul class="navbar-nav">

            <li class="nav-item">
                <a class="nav-link" data-widget="pushmenu" href="#" role="button"><i class="fas fa-bars"></i></a>
            </li>
            <li class="nav-item d-none d-sm-inline-block">
                <a href="/QslPage/homepage.html" target="user" class="nav-link">Home</a>
            </li>
        </ul>
        <!-- 右侧 -->
        <ul class="navbar-nav ml-auto">
            <li class="nav-item dropdown">
                <a class="nav-link" data-toggle="dropdown" href="#">
                    <i class="far fa-user"></i>
                </a>
                <div class="dropdown-menu dropdown-menu-lg dropdown-menu-right">
                    <a href="#" class="dropdown-item">
                        <!-- Message Start -->
                        <div class="media">
                            <div class="media-body">
                                <h3 class="dropdown-item-title">
                                    当前登录用户
                                </h3>
                                <p class="text-sm text-muted" id="curuser"><i class="far fa-clock mr-1"></i></p>
                            </div>
                        </div>
                        <!-- Message End -->
                    </a>
                    <div class="dropdown-divider">
                    </div>
                    <button id="quit" class="dropdown-item dropdown-footer">退出登录</button>
                </div>
            </li>
        </ul>
    </nav>
    <!-- /.顶部导航栏 -->

    <!--主要内容-->
    <div class="content-wrapper">
        <!--右侧iframe-->
        <iframe frameborder="0" name="user" scrolling="yes" src="/QslPage/homepage.html" style="width: 100%;height:810px">

        </iframe>
    </div>
    <!--/. 主要内容-->

    <!--左边栏-->
    <aside class="main-sidebar sidebar-dark-primary elevation-4">
        <!-- 品牌logo -->
        <a href="#" class="brand-link">
            <span class="brand-text font-weight-light">微小区</span>
        </a>
        <!-- 左侧导航 -->
        <div class="sidebar">
            <!-- Sidebar user panel (optional) -->
            <div class="user-panel mt-3 pb-3 mb-3 d-flex">
                <div class="image">
                    <img src="dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image">
                </div>
                <div class="info">
                    <a href="#" class="d-block" id="curuser-left"></a>
                </div>
            </div>
            <!-- Sidebar Menu -->
            <nav class="mt-2">
                <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu"
                    data-accordion="false">
                    <li class="nav-header">菜单栏</li>
                    <!--                    权限管理-->
                    <li class="nav-item">
                        <a href="#" class="nav-link">
                            <i class="fas fa-key"></i>
                            <p>
                                权限管理
                                <i class="fas fa-angle-left right"></i>
                            </p>
                        </a>
                        <ul class="nav nav-treeview">
                            <li class="nav-item li_power" id="emp">
                                <a href="./page/user.html" target="user" id="a-user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>员工管理</p>
                                </a>
                            </li>
                            <li class="nav-item li_power" id="resource">
                                <a href="./page/resource.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>资源管理</p>
                                </a>
                            </li>
                            <li class="nav-item li_power" id="role">
                                <a href="./page/role.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>角色管理</p>
                                </a>
                            </li>
                            <li class="nav-item li_power" id="log">
                                <a href="./page/log.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>查看日志</p>
                                </a>
                            </li>
                        </ul>
                    </li>
                    <!--                    楼栋管理-->
                    <li class="nav-item">
                        <a href="#" class="nav-link">
                            <i class="fas fa-building"></i>
                            <p>
                                楼栋管理
                                <i class="fas fa-angle-left right"></i>
                            </p>
                        </a>
                        <ul class="nav nav-treeview">
                            <li class="nav-item li_power" id="plot">
                            <a href="Fxypage/xqgl.html" target="user" class="nav-link">
                            <i class="far fa-circle nav-icon"></i>
                                    <p>小区</p>
                                </a>
                            </li>
                            <li class="nav-item li_power" id="build">
<!--                                <a href="ldgl.html" target="user" class="nav-link">-->
<!--                            <li class="nav-item">-->
                                <a href="Fxypage/ldgl.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>楼宇</p>
                                </a>
                            </li>
                            <li class="nav-item li_power" id="house">
                                <a href="Fxypage/fwgl.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>住房</p>
                                </a>
                            </li>
                            <li class="nav-item li_power" id="household">
                                <a href="Fxypage/ZhuHuGuanLi.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>住户</p>
                                </a>
                            </li>
                        </ul>
                    </li>
                    <!--                    车位管理-->
                    <li class="nav-item">
                        <a href="#" class="nav-link">
                            <i class="fas fa-car"></i>
                            <p>
                                车位管理
                                <i class="fas fa-angle-left right"></i>
                            </p>
                        </a>
                        <ul class="nav nav-treeview">
                            <li class="nav-item li_power" id="park">
                                <a href="/LzjPage/lzjTruck.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>车位管理</p>
                                </a>
                            </li>
                            <li class="nav-item li_power" id="car">
                                <a href="/LzjPage/lzjCar.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>车辆管理</p>
                                </a>
                        </ul>
                    </li>
                    <!--                    服务中心-->
                    <li class="nav-item">
                        <a href="#" class="nav-link">
                            <i class="fas fa-user-circle"></i>
                            <p>
                                服务中心
                                <i class="fas fa-angle-left right"></i>
                            </p>
                        </a>
                        <ul class="nav nav-treeview">
                            <li class="nav-item li_power" id="fwyd">
                                <a href="servicebook.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>服务预定</p>
                                </a>
                            </li>
                            <li class="nav-item li_power" id="xqhd">
                                <a href="activity.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>小区活动</p>
                                </a>
                            </li>
                            <li class="nav-item li_power" id="sqbx">
                                <a href="QslPage/repairs.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>申请报修</p>
                                </a>
                            </li>
                            <li class="nav-item li_power" id="wp">
                                <a href="QslPage/appoint.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>申请报修(委派)</p>
                                </a>
                            </li>
                            <li class="nav-item li_power" id="bxcl">
                                <a href="QslPage/cf.html" target="user"  class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>

                                    <p>报修处理</p>
                                </a>
                            </li>
                            <li class="nav-item li_power" id="wlgl">
                                <a href="/LzjPage/lzjMaterial.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>物料管理</p>
                                </a>
                            </li>
                        </ul>
                    </li>
                    <!--                    收费管理-->
                    <li class="nav-item">
                        <a href="#" class="nav-link">
                            <i class="fas fa-dollar-sign"></i>
                            <p>
                                收费管理
                                <i class="fas fa-angle-left right"></i>
                            </p>
                        </a>
                        <ul class="nav nav-treeview">
                            <li class="nav-item li_power" id="sfxm">
                                <a href="YXYpage/yxycharging.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>收费项目管理</p>
                                </a>
                            </li>
                            <li class="nav-item li_power" id="cblr">
                                <a href="YXYpage/yxyentering.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>抄表录入</p>
                                </a>
                            </li>
                            <li class="nav-item li_power" id="fycj">
                                <a href="YXYpage/yxypayment.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>费用催缴</p>
                                </a>
                            </li>
                            <li class="nav-item li_power" id="syjs">
                                <a href="YXYpage/yxysettlement.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>收银结算</p>
                                </a>
                            </li>
                            <li class="nav-item li_power" id="zd">
                                <a href="YXYpage/yxystatement.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>账单</p>
                                </a>
                            </li>
                        </ul>
                    </li>
                    <!--                    图表统计-->
                    <li class="nav-item">
                        <a href="#" class="nav-link">
                            <i class="fas fa-table"></i>
                            <p>
                                图表统计
                                <i class="fas fa-angle-left right"></i>
                            </p>
                        </a>
                        <ul class="nav nav-treeview">
                            <li class="nav-item li_power" id="bbhz">
                                <a href="/QslPage/YzTj.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>报表统计(户主)</p>
                                </a>
                            </li>
                            <li class="nav-item li_power" id="bbyz">
                                <a href="/QslPage/statisticalchart.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>报表统计(物业)</p>
                                </a>
                            </li>
                        </ul>
                    </li>
                    <!--                    问卷调查-->
                    <li class="nav-item">
                        <a href="#" class="nav-link">
                            <i class="fas fa-question"></i>
                            <p>
                                问卷调查
                                <i class="fas fa-angle-left right"></i>
                            </p>
                        </a>
                        <ul class="nav nav-treeview">
                            <li class="nav-item li_power" id="wj">
                                <a href="YXYpage/wenjuan.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>问卷管理</p>
                                </a>
                            </li>
                            <li class="nav-item li_power" id="tp">
                                <a href="YXYpage/Voting.html" target="user" class="nav-link">
                                    <i class="far fa-circle nav-icon"></i>
                                    <p>投票 详情</p>
                                </a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </nav>
        </div>
    </aside>
    <!--/.左边栏-->

</div>


<!-- jQuery -->
<script src="plugins/jquery/jquery.min.js"></script>

<!-- jQuery UI 1.11.4 -->
<script src="plugins/jquery-ui/jquery-ui.min.js"></script>
<!-- Resolve conflict in jQuery UI tooltip with Bootstrap tooltip -->
<script>
    $.widget.bridge('uibutton', $.ui.button)
</script>
<!-- Bootstrap 4 -->
<script src="plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- ChartJS -->
<script src="plugins/chart.js/Chart.min.js"></script>
<!-- Sparkline -->
<script src="plugins/sparklines/sparkline.js"></script>
<!-- jQuery Knob Chart -->
<script src="plugins/jquery-knob/jquery.knob.min.js"></script>
<!-- daterangepicker -->
<script src="plugins/moment/moment.min.js"></script>
<script src="plugins/daterangepicker/daterangepicker.js"></script>
<!-- Tempusdominus Bootstrap 4 -->
<script src="plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
<!-- Summernote -->
<script src="plugins/summernote/summernote-bs4.min.js"></script>
<!-- overlayScrollbars -->
<script src="plugins/overlayScrollbars/js/jquery.overlayScrollbars.min.js"></script>
<!-- AdminLTE App -->
<script src="dist/js/adminlte.js"></script>
<!-- AdminLTE for demo purposes -->
<script src="dist/js/demo.js"></script>
<script src="js/jquery.js"></script>

</body>
<script type="text/javascript">

    var powers = [];
    var user = new Map;
    //  获取session  得到当前登录用户
    $.ajax({
        url: "getcuruser",
        dataType: "json",
        success: function (resp) {
            user = resp
            $("#curuser").html(user.Hname)
            $("#curuser-left").html(user.Hname)
            if (user.Hname == null) {
                $("#curuser").html(user.ename)
                $("#curuser-left").html(user.ename)
            }
        }
    });
    setTimeout(function () {
        console.log(user)
        if (user.eid == null) {
            $("#wj").css("display", "inline")
            $("#tp").css("display", "inline")
            $("#zd").css("display", "inline")
            $("#sqbx").css("display", "inline")
            $("#bbhz").css("bbhz", "inline")
        } else {
            //   得到所有的权限
            $.ajax({
                url: "getcuruser_power/" + user.eid,
                dataType: "json",
                success: function (resp) {
                    powers = resp
                    console.log(powers)
                    for (let i = 0; i < powers.length; i++) {
                        let element = powers[i].power_url;
                        if (element!=null) {
                            $("#" + element + "").css("display", "inline")
                        }
                    }
                }
            })

        }

    }, 500)

//    quit 退出登录
    $("#quit").on( "click", function () {
    //        销毁session 跳转到登录页面

        $.ajax({
            url:"quitlogin",
            dataType:"json",
            success: function(resp){
                if (resp) {
                    location.href = "http://localhost:8686/login.html"
                }
            }

        })
    })

</script>
</html>